#ifndef __SRC_PACKET_H
#define __SRC_PACKET_H
#include <stdint.h>
#include <stdbool.h>
#define MAX_PACKET_SIZE 61 // 不包含 PACKET HREAD
typedef struct
{
    uint8_t localid;
    uint8_t packet_len;
    uint8_t remoteid;
} packet_head_t;

typedef struct
{
    packet_head_t head;
    uint8_t body_len;
    uint8_t *body;
    uint8_t chksum;
} packet_info_t;
bool parse_packet(int fd,uint8_t *data, int len);
bool parse_body(int fd, packet_info_t *packet);
void output_data(const char *text, uint8_t *data, int len);
#endif
